//
//  NetWorkManager.m
//  futureLive
//
//  Created by zhoubiwen on 15/11/16.
//  Copyright © 2015年 ZHOU_LI_SUN. All rights reserved.
//

#import "NetWorkManager.h"
@implementation NetWorkManager

+ (void)checkNet {
    
    [[AFNetworkReachabilityManager sharedManager] stopMonitoring];
    [[AFNetworkReachabilityManager sharedManager]setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
        NSLog(@"%ld",status);
    }];
    
}

+ (void)getJsonDataWithURL:(NSString *)url success:(void(^)(id data))success fail:(void(^)())fail {

[[AFHTTPSessionManager manager] GET:url parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nonnull responseObject) {
    
    success(responseObject);
    
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
    fail();
}];
    
}


@end
